package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

class zbcr extends CollectionBase implements zahw {
   private zif d;
   private zfq e;
   private zfq f;
   private ArrayList g;
   private ArrayList h;
   boolean b = false;
   boolean c = false;
   private ArrayList[] i;
   private ArrayList j = new ArrayList();
   private ArrayList[] k;

   zbcr(zif var1) {
      this.d = var1;
      this.e = new zfq((zfo)null);
      this.f = new zfq((zfo)null);
      this.g = new ArrayList();
      this.h = new ArrayList();
   }

   public zafs a() {
      return this.e;
   }

   public zafs b() {
      return this.f;
   }

   public ArrayList c() {
      return this.g;
   }

   public void a(ArrayList var1) {
      this.g = var1;
   }

   public ArrayList d() {
      return this.h;
   }

   public void b(ArrayList var1) {
      this.h = var1;
   }

   public ArrayList[] e() {
      return this.i;
   }

   public void a(ArrayList[] var1) {
      this.i = var1;
   }

   public ArrayList f() {
      return this.j;
   }

   public ArrayList[] g() {
      return this.k;
   }

   public void b(ArrayList[] var1) {
      this.k = var1;
   }

   public zahv a(int var1) {
      return (zbcp)this.a.get(var1);
   }

   zbcp c(int var1) {
      return (zbcp)this.a.get(var1);
   }

   public zahv b(int var1) {
      zbcp var2 = new zbcp(this.d, this, var1);
      var2.l(this.getCount());
      var2.b(this.getCount());
      var2.a(this.getCount());
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var2);
      return var2;
   }

   int a(zbcp var1) {
      int var2 = this.a.size();
      if (var1.ah() == null) {
         var1.a(this);
      }

      var1.a(this.d);
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      return this.a.size() - 1;
   }

   int h() {
      ArrayList var1 = new ArrayList();

      for(int var2 = 0; var2 < this.getCount(); ++var2) {
         com.aspose.cells.b.a.a.ze.a(var1, (Object)this.a(var2).k().getCount());
      }

      Collections.sort(var1);
      return (Integer)var1.get(var1.size() - 1);
   }

   zbcp d(int var1) {
      Iterator var2 = this.iterator();

      zbcp var3;
      do {
         if (!var2.hasNext()) {
            return null;
         }

         var3 = (zbcp)var2.next();
      } while(!var3.am() || var3.af() != var1);

      return var3;
   }

   int e(int var1) {
      int var2 = 0;
      Iterator var3 = this.iterator();

      while(var3.hasNext()) {
         zbcp var4 = (zbcp)var3.next();
         if (var4.am() && var1 == var4.af()) {
            ++var2;
         }
      }

      return var2;
   }

   zbcp a(int var1, int var2) {
      Iterator var3 = this.iterator();

      zbcp var4;
      do {
         if (!var3.hasNext()) {
            return null;
         }

         var4 = (zbcp)var3.next();
      } while(var4.m() != var2 || var1 != var4.af());

      return var4;
   }

   int b(int var1, int var2) {
      int var3 = 0;
      Iterator var4 = this.iterator();

      while(var4.hasNext()) {
         zbcp var5 = (zbcp)var4.next();
         if (var5.m() == var2 && var1 == var5.af()) {
            ++var3;
         }
      }

      return var3;
   }

   ArrayList i() {
      return this.a;
   }

   ArrayList j() {
      ArrayList var1 = new ArrayList();
      com.aspose.cells.b.a.a.ze.a(var1, (Collection)this.a);
      zbct var2 = new zbct();
      Collections.sort(var1, var2);
      return var1;
   }

   ArrayList k() {
      ArrayList var1 = this.j();
      return this.c(var1);
   }

   private ArrayList c(ArrayList var1) {
      ArrayList var2 = new ArrayList();
      if (var1.size() > 0) {
         com.aspose.cells.b.a.a.ze.a(var2, var1.get(0));
      }

      for(int var3 = 1; var3 < var1.size(); ++var3) {
         zbcp var4 = (zbcp)var1.get(var3);
         boolean var5 = false;

         for(int var6 = 0; var6 < var2.size(); ++var6) {
            zbcp var7 = (zbcp)var2.get(var6);
            if (var4.j() == var7.j() && var4.aB() < var7.aB()) {
               var2.add(var6, var4);
               var5 = true;
               break;
            }
         }

         if (!var5) {
            com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
         }
      }

      return var2;
   }

   List a(int var1, int[] var2) {
      ArrayList var3 = this.j();
      ArrayList var4 = new ArrayList();
      Iterator var5 = var3.iterator();

      while(var5.hasNext()) {
         zbcp var6 = (zbcp)var5.next();
         if (var6.a(var2) && var6.af() == var1) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
         }
      }

      return var4;
   }

   zbcp a(int var1, int var2, int[] var3) {
      List var4 = this.a(var2, var3);
      return var4.size() > var1 ? (zbcp)var4.get(var1) : null;
   }

   int a(zbcp var1, int var2, int[] var3) {
      ArrayList var4 = new ArrayList();
      Iterator var5 = this.iterator();

      while(true) {
         while(true) {
            zbcp var6;
            do {
               if (!var5.hasNext()) {
                  if (var4.size() > 0) {
                     zbct var11 = new zbct();
                     Collections.sort(var4, var11);

                     for(int var12 = 0; var12 < var4.size(); ++var12) {
                        zbcp var13 = (zbcp)var4.get(var12);
                        if (var1.equals(var13)) {
                           return var12;
                        }
                     }
                  }

                  return -1;
               }

               var6 = (zbcp)var5.next();
            } while(var6.af() != var2);

            int[] var7 = var3;
            int var8 = var3.length;

            for(int var9 = 0; var9 < var8; ++var9) {
               int var10 = var7[var9];
               if (var6.m() == var10 && var6.af() == var2) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  break;
               }
            }
         }
      }
   }

   ArrayList l() {
      ArrayList var1 = new ArrayList();
      ArrayList var2 = this.d.z().j();

      for(int var3 = 0; var3 < var2.size(); ++var3) {
         zbcp var4 = (zbcp)var2.get(var3);
         com.aspose.cells.b.a.a.ze.a(var1, (Collection)var4.F().c());
      }

      return var1;
   }

   ArrayList m() {
      ArrayList var1 = new ArrayList();

      for(int var2 = 0; var2 < this.a.size(); ++var2) {
         zbcp var3 = this.c(var2);
         if (!var3.j()) {
            for(int var4 = 0; var4 < var3.F().getCount(); ++var4) {
               com.aspose.cells.b.a.a.ze.a(var1, (Object)var3.F().a(var4));
            }
         }
      }

      return var1;
   }

   ArrayList n() {
      ArrayList var1 = new ArrayList();

      for(int var2 = 0; var2 < this.a.size(); ++var2) {
         zbcp var3 = this.c(var2);
         if (var3.j()) {
            for(int var4 = 0; var4 < var3.F().getCount(); ++var4) {
               com.aspose.cells.b.a.a.ze.a(var1, (Object)var3.F().a(var4));
            }
         }
      }

      return var1;
   }

   boolean o() {
      return this.l().size() != 0;
   }

   boolean p() {
      if (this.a == null) {
         return false;
      } else {
         Iterator var1 = this.a.iterator();

         zbcp var2;
         do {
            if (!var1.hasNext()) {
               return false;
            }

            var2 = (zbcp)var1.next();
         } while(!var2.ak());

         return true;
      }
   }

   // $FF: synthetic method
   public Object get(int x0) {
      return this.a(x0);
   }
}
